
variable "rrs" { type = list }
variable "zone" { type = string }
variable "alicloud_zone_id" { type = string }
variable "value" { type = string }
variable "type" { type = string }
variable "remark" { type = string }
variable "ttl" {
  type = number
  default = 60
}

resource "alicloud_pvtz_zone_record" "main" {
  zone_id = var.alicloud_zone_id

  type  = var.type
  ttl   = var.ttl
  value = lower(var.value)
  remark = var.remark

  for_each = toset(var.rrs)
  rr = each.value
}

resource "deeproute_dns_record" "main" {
  zone  = var.zone
  type  = var.type
  ttl   = var.ttl
  value = var.value

  for_each = toset(var.rrs)
  rr = each.value
}
